<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="./../template/WorkspaceTemplate.xhtml">

    <ui:define name="top">
        
    </ui:define>

    <ui:define name="left">
    </ui:define>

    <ui:define name="right">
   
    </ui:define>

    <ui:define name="content">
        <h:form>
            <p:panel id="panel" header="View All Sales Lead">
                <br/>
                <p:dataTable  styleClass="allaroundborder" value="#{salesLeadManagerBean.allSalesLead}" var="sl"
                              paginator="true" rows="10">

                    <f:facet name="header">  
                        List of Sales Leads
                    </f:facet>
                    
                    <p:column sortBy="#{sl.clientId}" filterBy="#{sl.clientId}">
                        <f:facet name="header">
                            <h:outputText value="Sales Lead ID" />
                        </f:facet>
                        <h:outputText value="#{sl.clientId}" />
                    </p:column>
                    
                    <p:column sortBy="#{sl.companyName}" filterBy="#{sl.companyName}">
                        <f:facet name="header">
                            <h:outputText value="Company Name" />
                        </f:facet>
                        <h:outputText value="#{sl.companyName}" />
                    </p:column>
                    
                    <p:column sortBy="#{sl.category}" filterBy="#{sl.category}">
                        <f:facet name="header">
                            <h:outputText value="Category" />
                        </f:facet>
                        <h:outputText value="#{sl.category}" />
                    </p:column>
                    
                    <p:column>
                        <p:commandButton id="view" image="ui-icon ui-icon-search" title="View" action="#{salesLeadManagerBean.viewSalesLead(sl.id)}"/>
                        <p:commandButton id="update" image="ui-icon ui-icon-pencil" title="Update" action="#{salesLeadManagerBean.updateSalesLead(sl.id)}" rendered="#{salesLeadManagerBean.renderUpdate(sl)}"/>
                        <p:commandButton id="convert" image="ui-icon ui-icon-refresh" title="Convert" action="#{salesLeadManagerBean.convertSalesLead(sl.id)}" rendered="#{salesLeadManagerBean.renderUpdate(sl)}"/>
                    </p:column>
                </p:dataTable>
            </p:panel>
        </h:form>
    </ui:define>

    <ui:define name="bottom">
       
    </ui:define>

</ui:composition>
